package com.mask.im.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mask.im.business.model.dto.*;
import com.mask.im.business.model.entity.chat.IMGroupChatDO;
import com.mask.im.business.model.vo.IMGroupChatVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * 群组管理
 *
 * @author jian
 */
@Mapper
@Repository
public interface IMGroupChatMapper extends BaseMapper<IMGroupChatDO> {
    /**
     * 获取用户群组列表
     *
     * @param userId
     * @return
     */
    List<IMGroupChatVO> getGroupList(@Param("userId") Long userId);

    /**
     * 获取对应群组信息
     * @param userId
     * @param groupId
     * @return
     */
    IMGroupChatVO getGroupData(@Param("userId") Long userId, @Param("groupId") Long groupId);

    List<FriendshipsDTO> getGroupChat(@Param("userId") Long userId);

    List<GroupMembersDTO> getGroupMembers(@Param("chatGroupId") Integer chatGroupId,
                                          @Param("page") long page,
                                          @Param("size") long size);
    Integer getGroupMembersCount(@Param("chatGroupId") Integer chatGroupId);

    Integer selectGroupChatCount(@Param("keywords") String keywords);

    List<GroupChatAdminDTO> selectGroupChatList(@Param("keywords") String keywords,
                                                @Param("page") long page,
                                                @Param("size") long size);
}

